<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('审核小组列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="album-form">
                <input type="hidden" id="albumIds" name="albumIds" th:value="${albumIds}">
                <div class="select-list">
                    <ul>
                        <li>
                            审核组名称：<input type="text" name="name"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "media/team";
    $(function() {
        var options = {
            url: prefix + "/list",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            clickToSelect: true,
            columns: [{
//                checkbox: true,
                field: 'selectItem',
                radio: true
            },
                {
                    field: 'id',
                    title: '小组ID'
                },
                {
                    field: 'name',
                    title: '小组名称'
                },
                {
                    field: 'remark',
                    title: '备注'
                }]
        };
        $.table.init(options);
    });

    /* 分配专辑给小组-选择小组-提交 */
    function submitHandler() {
        var rows = $.table.selectColumns("id");
        if (rows.length == 0) {
            $.modal.alertWarning("请选择一个审核小组");
            return;
        }
        var data = {"albumIds": $("#albumIds").val(), "teamId": rows.join()};
        $.operate.save(ctx + "media/album/assignTeam", data);
    }
</script>
</body>
</html>